import sys
from PyQt5.QtWidgets import  QHBoxLayout,QMainWindow,QApplication, QToolTip, QPushButton, QWidget
from PyQt5.QtGui import QFont

class TooltipFrom(QWidget):

    def __init__(self):
        super(TooltipFrom, self).__init__()
        self.initUI()
    def initUI(self):
        QToolTip.setFont(QFont('SansSerif', 12))
        self.setToolTip('今天是 <b>星期五</b>')
        self.setGeometry(300, 300, 300, 300)
        self.setWindowTitle("控件信息")
        self.show()
if __name__ == '__main__':

    app = QApplication(sys.argv)
    main = TooltipFrom()
    sys.exit(app.exec_())